package com.lelouch.examplecode.designpattern.delegate.bossleader;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lcy
 * @create 2018-10-11 09:13
 * 负责具体的分发工作到员工
 */
public class Leader {
    //需要维护具体的被委派者的引用
    private Map<String,IEmployee> employeeHashMap = new HashMap<String,IEmployee>();

    public Leader(){
        employeeHashMap.put("销售",new EmployeeA());
        employeeHashMap.put("测试",new EmployeeB());
    }
    public void doWork(String work){
        employeeHashMap.get(work).doWork(work);
    }
}
